# coding=UTF-8
# 导入模块
from openpyxl import load_workbook
# 导入一个Workbook

#excel名字
excelName='b.xlsx'

#sheet名字
sheetName='heyuan'

#写入的行
wRow=5
#读取对比的行
rRow=4


wb = load_workbook(filename = excelName)
sheet=wb.get_sheet_by_name(sheetName)
row_max=sheet.max_row
print(row_max)
print(sheet.cell(row=1, column=1).value)

for r in range(1,row_max):
    if sheet.cell(row=r, column=wRow).value ==None:
        print(sheet.cell(row=r, column=rRow).value)
        sheet['E' + str(r)].value =sheet.cell(row=r, column=rRow).value

        pass
    else:
        pass
        print(sheet.cell(row=r, column=3).value)



wb.save('b_gy.xlsx')